﻿#region

using System;
using System.Messaging;

#endregion

namespace NsbMonitorClientService.QueueManager
{
    public class BasicQueuePurger : IQueuePurger
    {
        public void PurgeQueue(string queueFullPath)
        {
            if (!MessageQueue.Exists(queueFullPath))
            {
                throw new ArgumentException("cannot find queue: " + queueFullPath);
            }


            using (MessageQueue queue = new MessageQueue(queueFullPath))
            {
                queue.Purge();
            }
        }
    }
}